export const hasRoute = function (name, routeList) {
  !routeList && (routeList = this.$router.options.routes);
  for (let i = 0; i < routeList.length; i++) {
    console.log(routeList[i]);
    if (routeList[i].name === name) {
      return true;
    }
    if (routeList[i].children) {
      let flag = hasRoute(name, routeList[i].children);
      if (flag) {
        return flag;
      }
    }
  }
  return false;
};
